package com.jinghao.ctws.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import com.jinghao.core.common.exception.JingHaoCustomerException;
import com.jinghao.core.common.service.impl.JingHaoBaseServiceImpl;
import com.jinghao.core.common.util.cnd.JhCnd;
import com.jinghao.ctws.entity.CwvCamera;
import com.jinghao.ctws.service.ICwvCameraService;
import com.jinghao.ctws.util.EJhCTwsCode;

@Service("cwvCameraService")
public class CwvCameraServiceImpl extends JingHaoBaseServiceImpl<CwvCamera> implements ICwvCameraService {
	//==================定制内容开始======================
//在这里修改代码
	@Override
	public void listCwvCamera(CwvCamera model) {
		JhCnd cnd=new JhCnd();
		if (StringUtils.isEmpty(model.getFjhorgUuid())) {
			throw new JingHaoCustomerException(EJhCTwsCode.CTWS1001.getCode(),"仓库UUID不能为空，请重新输入!");
		}else{
			cnd.andEquals("fjhorgUuid");
		}
		if (!StringUtils.isEmpty(model.getDeviceName())) {
			model.setDeviceName("%"+model.getDeviceName()+"%");
			cnd.andLike("deviceName");
		}  
		if (!StringUtils.isEmpty(model.getDeviceId())) {
			cnd.andEquals("deviceId");
		}
		if (!StringUtils.isEmpty(model.getCameraUuid())) {
			cnd.andEquals("cameraUuid");
		}
		model.lnkCnd(cnd); 
		model.setMapList(this.queryMapList(model));
		
	}
	//==================定制内容结束======================
}
